package com.arpa.wms.domain.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author: Allen chen
 * @Date 2020/8/12
 * @Description:
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="Goods对象", description="商品")
@TableName("base_goods")
public class Goods extends BasicEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(hidden = true,value = "数据标识")
    @TableField("code")
    private String code;

    @ApiModelProperty(value = "所属货主")
    @TableField("shipment_code")
    private String shipmentCode;

    @ApiModelProperty(value = "所属货主")
    @TableField("shipment_name")
    private String shipmentName;

     @ApiModelProperty(value = "仓库")
     @TableField("warehouse_code")
     private String warehouseCode;

    @ApiModelProperty(value = "商品类型")
    @TableField("type_code")
    private String typeCode;

    @ApiModelProperty(value = "商品分类名称")
    @TableField("type_name")
    private String typeName;

    @ApiModelProperty(value = "商品名称")
    @TableField("name")
    @NotBlank(message = "商品名称不能为空！")
    @Length(max = 100, message = "商品名称长度不能大于100")
    private String name;

    /**
     * 0：原料 1：成品  2：半成品
     */
    @ApiModelProperty(value = "商品分类 0：原料 1：成品  2：半成品")
    @TableField("type")
    private String type;

    @ApiModelProperty(value = "可销售 0：否，1：是")
    @TableField("sale")
    private Integer sale;

    @ApiModelProperty(value = "可采购 0：否，1：是")
    @TableField("purchase")
    private Integer purchase;

    @ApiModelProperty(value = "品牌code")
    @TableField("brand_code")
    private String brandCode;

    @ApiModelProperty(value = "混放策略 0:商品混放，1：批次混放，2：混放，3：不混放")
    @TableField("storage_strategy")
    private String storageStrategy;

    @ApiModelProperty(value = "商品编码")
    @TableField("good_code")
    @NotBlank(message = "商品编码不能为空！")
    @Length(max = 100, message = "商品编码长度不能大于100")
    private String goodCode;

    @ApiModelProperty(value = "商品条码")
    @TableField("bar_code")
    @NotBlank(message = "商品条码不能为空！")
    @Length(max = 100, message = "商品条码长度不能大于100")
    private String barCode;

    @ApiModelProperty(value = "基本单位code")
    @TableField("unit_code")
    private String unitCode;

    @ApiModelProperty(value = "基本单位名称")
    @TableField(exist = false)
    private String basicUnitName;

    @ApiModelProperty(value = "单位精度")
    @TableField("unit_precision")
    private BigDecimal unitPrecision;

    @ApiModelProperty(value = "规格")
    @TableField("spec")
    @Length(max = 100, message = "规格长度不能大于100")
    private String spec;

    @ApiModelProperty(value = "批号规则code")
    @TableField("lot_number")
    private String lotNumber;

    @ApiModelProperty(value = "保质期（天）")
    @TableField("quality")
    private BigDecimal quality;

    @ApiModelProperty(value = "临期预警（天）")
    @TableField("early_warning")
    private BigDecimal earlyWarning;

    @ApiModelProperty(value = "收货预警（天）")
    @TableField("receiving_warning")
    private BigDecimal receivingWarning;

    @ApiModelProperty(value = "发货预警（天）")
    @TableField("send_warning")
    private BigDecimal sendWarning;

    @ApiModelProperty(value = "库存类型")
    @TableField("stock_type")
    private String stockType;

    @ApiModelProperty(value = "重量")
    @TableField("weight")
    private BigDecimal weight;

    @ApiModelProperty(value = "体积")
    @TableField("volume")
    private BigDecimal volume;

    @ApiModelProperty(value = "补货倍数")
    @TableField("multiple")
    private BigDecimal multiple;



    @ApiModelProperty(hidden = true,value = "状态，0-启用，1-停用")
    @TableField("status")
    private String status;

    @ApiModelProperty(hidden = true,value = "是否可删除标识")
    @TableField("delete_flag")
    private String deleteFlag;



    @ApiModelProperty(hidden = true,value = "所属机构")
    @TableField("party_group_code")
    private String partyGroupCode;

    @ApiModelProperty(hidden = true,value = "备注")
    @TableField("remark")
    private String remark;

    @ApiModelProperty(hidden = true,value = "奇门商品同步类型(ZC=正常商品, FX=分销商品, ZH=组合商品, ZP=赠品, BC=包 \n" +
            "材, HC=耗材, FL=辅料, XN=虚拟品, FS=附属品, CC=残次品, OTHER=其它)")
    @TableField("item_type")
    private String itemType;

    @ApiModelProperty(value = "商品类型：0普通商品，1组合商品")
    @TableField(value = "record_type")
    private Integer recordType;

    @ApiModelProperty(value = "进货价格")
    @TableField(value = "receipt_price")
    private BigDecimal receiptPrice;

    @ApiModelProperty(value = "销售价格")
    @TableField(value = "delivery_price")
    private BigDecimal deliveryPrice;

    @ApiModelProperty(value = "单位明细")
    @TableField(exist = false)
    private List<GoodsUnitConversion> goodsUnitConversionList;


    @ApiModelProperty(value = "批次规则")
    @TableField(exist = false)
    private Map<String,Object> batchRule;

}
